package com.hfzy.ihk.web.freeswitchCall;

import com.alibaba.dubbo.config.spring.context.annotation.EnableDubbo;
import com.hfzy.ihk.common.util.http.HttpClientUtils;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchAutoConfiguration;
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
import org.springframework.boot.autoconfigure.kafka.KafkaAutoConfiguration;
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;

/**
 * Created by Administrator on 2017/12/1.
 *
 * @author wws
 */
@SpringBootApplication(exclude = {
        ElasticsearchAutoConfiguration.class,
        RedisAutoConfiguration.class,
        KafkaAutoConfiguration.class,
        SecurityAutoConfiguration.class
})
@ComponentScan(basePackages = "com.hfzy.ihk")
@EnableDubbo(scanBasePackages = "com.hfzy.ihk.web.freeswitchCall.serviceImpl")
@EnableScheduling
//@EnableElasticsearchRepositories({"com.hfzy.ihk.customer.es.dao"})
//@EnableScheduling
//@EnableRedisHttpSession(maxInactiveIntervalInSeconds=2048)  //超时时间1个小时
//@ServletComponentScan
//@EnableAsync
//@EnableTransactionManagement
//@EnableCaching
//@EnableAspectJAutoProxy(exposeProxy = true)
@EnableAsync
public class Application {


    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
//
    @Bean
    public CommandLineRunner commandLineRunner(ApplicationContext ctx) {
        return (String... args) -> {
//            if("true".equals(aliyun)) {
//                AliyunMsgInti.intiVoiceRTASRReport();//初始化接受asr 长连接
//                AliyunMsgInti.intiVoiceCallReport();
//            }
            //初始化http连接池
            HttpClientUtils.init();
        };
    }



}
